#include <stdio.h>
#include <math.h>

int main(){
    double a, n, sum = 0, temp = 0;
    scanf("%lf,%lf", &a, &n);
    for (int i = 0; i < n; i++){
        temp = temp * 10 + a;
        sum += temp;
    }
    printf("s=%.0lf", sum);
    return 0;
}
